/**
 * 作者: hxl
 * 日期: 2025-05-26 15:40:29
 * 备注: 用户联盟乱斗干员快照表
 */
package com.motu.monstercity.server.game.userdata;

import com.motu.monstercity.server.game.logic.PartnerManager;
import com.motu.vertx.module.utility.model.EntityManager;

public class UserUnionScufflePartner extends UserUnionScufflePartnerModel {
    public UserUnionScufflePartner() {
        super();
    }
    public UserUnionScufflePartner(long userId, long actId, UserPartner userPartner) {
        putUserId(userId);
        putActId(actId);
        putMemberId(userPartner.getUserId());
        putPartnerId(userPartner.getPartnerId());
        String actListKey = EntityManager.getFieldJoinString(userId, actId, memberId);
        putGroupListKey(actListKey);
        initData(userPartner);
    }

    public void initData(UserPartner userPartner) {
        putTotalPower(userPartner.getTotalPower());
        UserWeapon userWeapon = PartnerManager.getUserWeapon(userPartner.getUserId(), userPartner.getWeaponDbid());
        if (userWeapon != null) {
            putWeaponId(userWeapon.getWeaponId());
        }
    }

}
